<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center farmTools_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub farmTools_fd0_0'>
          <view class='flex flex-wrap align-center farmTools_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  farmTools_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='farmTools_fd0_0_c1_c0' v-if=" id=='1'">大型农具押金</text><text class='farmTools_fd0_0_c1_c0'
              v-if=" id=='2'">中型农具押金</text>
            <text class='farmTools_fd0_0_c1_c0' v-if=" id=='3'">小型农具押金</text>
          </view>
          <view class='flex flex-wrap align-center justify-end farmTools_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout farmTools_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch farmTools_fd1_0'>
          <text class='farmTools_fd1_0_c0'>退还须知</text>
          <jyf-parser class='farmTools_fd1_0_c1' :html="datas.return_back_note | richTextFormat">
          </jyf-parser>
          <view class='flex flex-direction flex-wrap align-center farmTools_fd1_0_c2'>
            <image class='farmTools_fd1_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"69.png"'></image>
            <view class='flex flex-wrap align-center farmTools_fd1_0_c2_c1'>
              <text class='farmTools_fd1_0_c2_c1_c0'>押金</text>
              <text class='farmTools_fd1_0_c2_c1_c0'>{{price}}</text>
              <text class='farmTools_fd1_0_c2_c1_c0'>元</text>
            </view>
            <text class='farmTools_fd1_0_c2_c2'>请扫码支付大型农具押金，并上传支付凭证。</text>
          </view>
        </view>
        <view class='flex flex-wrap align-center farmTools_fd1_1'>
        </view>
        <text class='farmTools_fd1_2'>上传支付凭证</text>
        <benben-images-upload ref="benbenImagesUploadfd1_3" :is-show-tips='true' :maxlength="9" :img-list.sync="img"
          :img-ids.sync="img_id">
          <template #content="{ num, maxlength, isShow, imgList }">
            <view class="flex flex-wrap align-start flex farmTools_fd1_3">

              <view v-for="(image, index) in imgList" :key="index" class='flex position-relative farmTools_fd1_30'>
                <text class='fu-iconfont2 position-absolute farmTools_fd1_300'
                  @tap.stop="$refs.benbenImagesUploadfd1_3.delImage(index)">&#xE8E7;</text>
                <image class='farmTools_fd1_301' @tap.stop="$refs.benbenImagesUploadfd1_3.previewImage(index)"
                  mode="aspectFit" :src='image'></image>
              </view>

              <image class='farmTools_fd1_31' @tap.stop="$refs.benbenImagesUploadfd1_3.manyChooseImage()" v-if="isShow"
                mode="aspectFit" :src='STATIC_URL+"70.png"'></image>
              <text class='image_upload_tips farmTools_fd1_32'>请上传支付凭证后提交审核</text>
            </view>
          </template>
        </benben-images-upload>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex flex-wrap align-stretch justify-center benben-position-layout flex farmTools_flex_2">
        <button class='farmTools_fd2_0' @tap.stop="submitReviewFunc()">提交审核</button>

      </view>
      <view :style="{height: '120rpx'}"></view>


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "pay_images": "",
        "datas": {
          "bank_account": "",
          "bank_name": "",
          "bank_open": "",
          "big_pledge": "",
          "middle_pledge": "",
          "name": "",
          "pay_offline_images": "",
          "return_back_note": "",
          "small_pledge": ""
        },
        "id": "",
        "price": "",
        "img": [],
        "img_id": "",
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        id,
        price
      } = options
      if (id !== undefined) this.id = id
      if (price !== undefined) this.price = price
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.gePayFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //提交审核
      async submitReviewFunc() {
        console.log('pppp', this.img)
        // if (!validate(this.img, 'require')) {
        //   this.$message.info('支付凭证不能为空');
        //   return false;
        // }
        if (this.img.length == 0) {
          this.$message.info('支付凭证不能为空');
          return false;
        }
        //请求方法
        //数据验证

        let data6528d7fa6bab9 = await this.$api.post(global.apiUrls.post6528d7fa6bab9, {
          type: this.id,
          payable_money: this.price,
          // pay_images: this.pay_images,
          pay_images: this.img.join(',')
        });

        if (data6528d7fa6bab9.data.code != 1) {
          this.$message.info(data6528d7fa6bab9.data.msg);
          return
        }


        this.$urouter.redirectTo(`/pages/my/audit/audit?examine=1`);
      },
      //获取线下支付
      async gePayFunc() {
        //请求方法
        //数据验证

        let datadatas = await this.$api.post(global.apiUrls.post63904efcaa202, {

        });

        if (datadatas.data.code != 1) {
          this.$message.info(datadatas.data.msg);
          return
        }
        let infodatas = datadatas.data;
        this.datas = infodatas.data
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .farmTools_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .farmTools_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
    line-height: 88rpx;
  }

  .farmTools_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .farmTools_fd0_0_c0 {
    width: 120rpx;
  }

  .farmTools_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .farmTools_flex_1 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .farmTools_fd1_32 {
    font-size: 32rpx;
    color: rgba(153, 153, 153, 1);
    width: 100%;
  }

  .farmTools_fd1_31 {
    width: 172rpx;
    height: 172rpx;
    margin: 0rpx 24rpx 16rpx 0rpx;
  }

  .farmTools_fd1_301 {
    width: 172rpx;
    height: 172rpx;
  }

  .farmTools_fd1_300 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .farmTools_fd1_30 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .farmTools_fd1_3 {
    width: 750rpx;
    padding: 32rpx 0rpx 0rpx 24rpx;
  }

  .farmTools_fd1_2 {
    margin: 0rpx 0rpx 0rpx 24rpx;
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
  }

  .farmTools_fd1_1 {
    background: #F8F8F8;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    width: 750rpx;
    height: 16rpx;
    margin: 0rpx 0rpx 32rpx 0rpx;
  }

  .farmTools_fd1_0_c2_c2 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
  }

  .farmTools_fd1_0_c2_c1_c0 {
    color: #E63838;
    font-size: 28rpx;
    font-weight: 500;
  }

  .farmTools_fd1_0_c2_c1 {
    margin: 0rpx 0rpx 16rpx 0rpx;
  }

  .farmTools_fd1_0_c2_c0 {
    width: 260rpx;
    height: 260rpx;
    margin: 0rpx 0rpx 16rpx 0rpx;
  }

  .farmTools_fd1_0_c2 {
    margin: 0rpx 0rpx 32rpx 0rpx;
  }

  ::v-deep .farmTools_fd1_0_c1 {
    border-bottom: 1px solid #eee;
    width: 100%;
    margin: 24rpx 0rpx 32rpx 0rpx;
    padding: 0rpx 0rpx 32rpx 0rpx;
  }

  .farmTools_fd1_0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
  }

  .farmTools_fd1_0 {
    margin: 0rpx 24rpx 0rpx 24rpx;
  }

  .farmTools_flex_2 {
    background: var(--benbenbgColor1);
    width: 750rpx;
    height: 120rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto;
  }

  .farmTools_fd2_0 {
    background: #E63838;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 702rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    height: 88rpx;
  }
</style>
